package com.huanong.it.xwweibo.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huanong.it.xwcommon.entity.Comment;
import com.huanong.it.xwcommon.entity.User;
import com.huanong.it.xwcommon.service.CommentService;
import com.huanong.it.xwcommon.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class CommentApi {
    @Autowired
    private CommentService commentService;
    //添加评论
    @PostMapping("/comment")
    public Result<Comment> addComment(@RequestBody Integer wbid, @RequestBody String content){
        return commentService.addComment(wbid, content);
    }
    @DeleteMapping("/comment")
    public Result<Comment> delComment(@RequestBody Integer cmid){
        return commentService.delComment(cmid);
    }
    @PatchMapping("/comment")
    public Result<Comment> updateComment(@RequestBody Integer cmid, @RequestBody String content){
        return commentService.updateComment(cmid, content);
    }
}
